package ningbo.day06.oop1;

/**
 * @Author 宁铂
 * @Date 2021/7/18 12:58
 * @Version 1.0
 */
public class TestPrivate {
    /** 测试面向对象的封装 */
    public static void main(String[] args) {
        Person person = new Person();
        person.setName("wudi");
        person.setAge(18);
        person.setHeight(185.8);

        System.out.println(person.getName());
        System.out.println(person.getAge());
        System.out.println(person.getHeight());
    }
}


class Person{
    private String name;
    private int age;
    private double height;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public Person(String name, int age, double height) {
        this.name = name;
        this.age = age;
        this.height = height;
    }

    public Person() {

    }
}